package com.cwx.service;

import com.cwx.pojo.Blog;
import com.cwx.vo.BlogQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

public interface BlogService {

    Blog getBlog(Long id);

    //通过queryblog类来查询博客 blogquery中有typeid，title，recommend是否推荐
    Page<Blog> listBlog(Pageable pageable, BlogQuery blog);

    Page<Blog> listBlog(Pageable pageable);

    Blog saveBlog(Blog blog);

    Blog updateBlog(Long id,Blog blog);

    void deleteBlog(Long id);

    //按照更新时间查出最新的博客
    List<Blog> listBlogTop(Integer size);

    //按照搜索查询博客
    Page<Blog> ListBlogSearch(String query,Pageable pageable);

    //根据Id查找制定博客并把他转换为html文本返回
    Blog getAndConvert(Long id);

    //根据博客的标签id   来查询博客
    Page<Blog> listBlog(Long tagId,Pageable pageable);

    //归档  查询出年份 博客对于的list集合
    Map<String,List<Blog>> archivers();

    Long countBlog();
}
